package com.jtlrm.ckd.mvp.view.activity;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.base.sdk.util.AppUtil;
import com.base.sdk.util.CommonUtil;
import com.base.sdk.util.PhoneUtil;
import com.jtlrm.ckd.R;
import com.jtlrm.ckd.base.acitvity.TitleBarActivity;

import butterknife.BindView;

public class AboutUsActivity extends TitleBarActivity {

    @BindView(R.id.phone)
    TextView phoneT;
    @BindView(R.id.url)
    TextView urlT;

    @BindView(R.id.version)
    TextView versionT;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    protected String getTitleText() {
        return "关于我们与帮助";
    }

    @Override
    protected void setContentLayout() {
        setContentView(R.layout.activity_about_us);
    }

    @Override
    protected void initView() {
        setText(versionT, "V " + AppUtil.getAppVersionName(context));
    }

    @Override
    protected void obtainData() {

    }

    @Override
    protected void initEvent() {
        phoneT.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                PhoneUtil.diallPhone(context, getTextStr(phoneT));
            }
        });
        urlT.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Uri uri = Uri.parse(getTextStr(urlT));
                Intent intent = new Intent(Intent.ACTION_VIEW, uri);
                startActivity(intent);
            }
        });

    }

}
